package com.gh.test;

import com.alibaba.excel.context.AnalysisContext;
import com.alibaba.excel.event.AnalysisEventListener;

import java.util.Map;

/**
 * @Author Eric
 * @Date 2021/6/6 12:48
 * @Version 1.0
 */
public class ExcelListener extends AnalysisEventListener<TestDataEntity> {
    //一行一行读取Excel数据,从第二行开始读
    @Override
    public void invoke(TestDataEntity testDataEntity, AnalysisContext analysisContext) {
        System.out.println(testDataEntity);
    }
    //读取表头信息
    @Override
    public void invokeHeadMap(Map<Integer, String> headMap, AnalysisContext context) {
        System.out.println("===============");
        System.out.println(headMap);
    }
    //读取之后执行
    @Override
    public void doAfterAllAnalysed(AnalysisContext analysisContext) {

    }
}
